#include <cstdio>

int main(int argc, char* argv[]){
  int N,i,j,r,n=1;
  char c;
  scanf("%d %c",&N,&c);
  while(N >= 2*n*n - 1)
    n++;
  n = n - 1;
  r = N - (2*n*n - 1);
  for (i = 1 ; i <= n ; i++ ){
    for (j = i - 1 ; j > 0 ; j-- )
      printf("%c",' ');
    for (j = 2*(n-i)+1 ; j > 0 ; j--)
      printf("%c",c);
    printf("\n");
  }
  for (i = n - 1 ; i >= 1 ; i-- ){
    for (j = i - 1 ; j > 0 ; j-- )
      printf("%c",' ');
    for (j = 2*(n-i)+1 ; j > 0 ; j--)
      printf("%c",c);
    printf("\n");
  }
  printf("%d",r);
}
